.class public Lcom/evernote/client/android/EvernoteOAuthActivity;
.super Landroid/app/Activity;
.source "EvernoteOAuthActivity.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/evernote/client/android/EvernoteOAuthActivity$CompleteAuthAsyncTask;,
        Lcom/evernote/client/android/EvernoteOAuthActivity$BootstrapAsyncTask;
    }
.end annotation


# static fields
.field static final EXTRA_BOOTSTRAP_SELECTED_PROFILE:Ljava/lang/String; = "BOOTSTRAP_SELECTED_PROFILE"

.field static final EXTRA_BOOTSTRAP_SELECTED_PROFILES:Ljava/lang/String; = "BOOTSTRAP_SELECTED_PROFILES"

.field static final EXTRA_BOOTSTRAP_SELECTED_PROFILE_POS:Ljava/lang/String; = "BOOTSTRAP_SELECTED_PROFILE_POS"

.field static final EXTRA_CONSUMER_KEY:Ljava/lang/String; = "CONSUMER_KEY"

.field static final EXTRA_CONSUMER_SECRET:Ljava/lang/String; = "CONSUMER_SECRET"

.field static final EXTRA_EVERNOTE_SERVICE:Ljava/lang/String; = "EVERNOTE_HOST"

.field static final EXTRA_REQUEST_TOKEN:Ljava/lang/String; = "REQUEST_TOKEN"

.field static final EXTRA_REQUEST_TOKEN_SECRET:Ljava/lang/String; = "REQUEST_TOKEN_SECRET"

.field static final EXTRA_SUPPORT_APP_LINKED_NOTEBOOKS:Ljava/lang/String; = "SUPPORT_APP_LINKED_NOTEBOOKS"

.field private static final LOGTAG:Ljava/lang/String; = "EvernoteOAuthActivity"


# instance fields
.field private final DIALOG_PROGRESS:I

.field private mActivity:Landroid/app/Activity;

.field private mBackBtn:Landroid/view/View;

.field private mBeginAuthSyncTask:Landroid/os/AsyncTask;

.field private mBootstrapProfiles:Ljava/util/ArrayList;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/ArrayList",
            "<",
            "Lcom/evernote/edam/userstore/BootstrapProfile;",
            ">;"
        }
    .end annotation
.end field

.field private mCompleteAuthSyncTask:Landroid/os/AsyncTask;

.field private mConsumerKey:Ljava/lang/String;

.field private mConsumerSecret:Ljava/lang/String;

.field private mEvernoteService:Lcom/evernote/client/android/EvernoteSession$EvernoteService;

.field private mRequestToken:Ljava/lang/String;

.field private mRequestTokenSecret:Ljava/lang/String;

.field private mSelectedBootstrapProfile:Lcom/evernote/edam/userstore/BootstrapProfile;

.field private mSelectedBootstrapProfilePos:I

.field private mSupportAppLinkedNotebooks:Z

.field private mSwitchTxt:Landroid/widget/TextView;

.field private mTitleTxt:Landroid/widget/TextView;

.field private mWebChromeClient:Landroid/webkit/WebChromeClient;

.field private mWebView:Landroid/webkit/WebView;

.field private mWebViewClient:Landroid/webkit/WebViewClient;


# direct methods
.method public constructor <init>()V
    .registers 4

    .prologue
    const/4 v2, 0x0

    const/4 v1, 0x0

    .line 66
    invoke-direct {p0}, Landroid/app/Activity;-><init>()V

    .line 79
    iput-object v1, p0, Lcom/evernote/client/android/EvernoteOAuthActivity;->mEvernoteService:Lcom/evernote/client/android/EvernoteSession$EvernoteService;

    .line 82
    iput v2, p0, Lcom/evernote/client/android/EvernoteOAuthActivity;->mSelectedBootstrapProfilePos:I

    .line 83
    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    iput-object v0, p0, Lcom/evernote/client/android/EvernoteOAuthActivity;->mBootstrapProfiles:Ljava/util/ArrayList;

    .line 85
    iput-object v1, p0, Lcom/evernote/client/android/EvernoteOAuthActivity;->mConsumerKey:Ljava/lang/String;

    .line 86
    iput-object v1, p0, Lcom/evernote/client/android/EvernoteOAuthActivity;->mConsumerSecret:Ljava/lang/String;

    .line 87
    iput-object v1, p0, Lcom/evernote/client/android/EvernoteOAuthActivity;->mRequestToken:Ljava/lang/String;

    .line 88
    iput-object v1, p0, Lcom/evernote/client/android/EvernoteOAuthActivity;->mRequestTokenSecret:Ljava/lang/String;

    .line 89
    iput-boolean v2, p0, Lcom/evernote/client/android/EvernoteOAuthActivity;->mSupportAppLinkedNotebooks:Z

    .line 91
    const/16 v0, 0x65

    iput v0, p0, Lcom/evernote/client/android/EvernoteOAuthActivity;->DIALOG_PROGRESS:I

    .line 97
    iput-object v1, p0, Lcom/evernote/client/android/EvernoteOAuthActivity;->mBeginAuthSyncTask:Landroid/os/AsyncTask;

    .line 98
    iput-object v1, p0, Lcom/evernote/client/android/EvernoteOAuthActivity;->mCompleteAuthSyncTask:Landroid/os/AsyncTask;

    .line 106
    new-instance v0, Lcom/evernote/client/android/EvernoteOAuthActivity$1;

    invoke-direct {v0, p0}, Lcom/evernote/client/android/EvernoteOAuthActivity$1;-><init>(Lcom/evernote/client/android/EvernoteOAuthActivity;)V

    iput-object v0, p0, Lcom/evernote/client/android/EvernoteOAuthActivity;->mWebViewClient:Landroid/webkit/WebViewClient;

    .line 124
    new-instance v0, Lcom/evernote/client/android/EvernoteOAuthActivity$2;

    invoke-direct {v0, p0}, Lcom/evernote/client/android/EvernoteOAuthActivity$2;-><init>(Lcom/evernote/client/android/EvernoteOAuthActivity;)V

    iput-object v0, p0, Lcom/evernote/client/android/EvernoteOAuthActivity;->mWebChromeClient:Landroid/webkit/WebChromeClient;

    .line 473
    return-void
.end method

.method static synthetic access$000(Lcom/evernote/client/android/EvernoteOAuthActivity;)Ljava/lang/String;
    .registers 2
    .param p0, "x0"    # Lcom/evernote/client/android/EvernoteOAuthActivity;

    .prologue
    .line 66
    invoke-direct {p0}, Lcom/evernote/client/android/EvernoteOAuthActivity;->getCallbackScheme()Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method static synthetic access$100(Lcom/evernote/client/android/EvernoteOAuthActivity;)Landroid/os/AsyncTask;
    .registers 2
    .param p0, "x0"    # Lcom/evernote/client/android/EvernoteOAuthActivity;

    .prologue
    .line 66
    iget-object v0, p0, Lcom/evernote/client/android/EvernoteOAuthActivity;->mCompleteAuthSyncTask:Landroid/os/AsyncTask;

    return-object v0
.end method

.method static synthetic access$1000(Lcom/evernote/client/android/EvernoteOAuthActivity;)Lorg/scribe/oauth/OAuthService;
    .registers 2
    .param p0, "x0"    # Lcom/evernote/client/android/EvernoteOAuthActivity;

    .prologue
    .line 66
    invoke-direct {p0}, Lcom/evernote/client/android/EvernoteOAuthActivity;->createService()Lorg/scribe/oauth/OAuthService;

    move-result-object v0

    return-object v0
.end method

.method static synthetic access$102(Lcom/evernote/client/android/EvernoteOAuthActivity;Landroid/os/AsyncTask;)Landroid/os/AsyncTask;
    .registers 2
    .param p0, "x0"    # Lcom/evernote/client/android/EvernoteOAuthActivity;
    .param p1, "x1"    # Landroid/os/AsyncTask;

    .prologue
    .line 66
    iput-object p1, p0, Lcom/evernote/client/android/EvernoteOAuthActivity;->mCompleteAuthSyncTask:Landroid/os/AsyncTask;

    return-object p1
.end method

.method static synthetic access$1100(Lcom/evernote/client/android/EvernoteOAuthActivity;)Ljava/lang/String;
    .registers 2
    .param p0, "x0"    # Lcom/evernote/client/android/EvernoteOAuthActivity;

    .prologue
    .line 66
    iget-object v0, p0, Lcom/evernote/client/android/EvernoteOAuthActivity;->mRequestToken:Ljava/lang/String;

    return-object v0
.end method

.method static synthetic access$1102(Lcom/evernote/client/android/EvernoteOAuthActivity;Ljava/lang/String;)Ljava/lang/String;
    .registers 2
    .param p0, "x0"    # Lcom/evernote/client/android/EvernoteOAuthActivity;
    .param p1, "x1"    # Ljava/lang/String;

    .prologue
    .line 66
    iput-object p1, p0, Lcom/evernote/client/android/EvernoteOAuthActivity;->mRequestToken:Ljava/lang/String;

    return-object p1
.end method

.method static synthetic access$1200(Lcom/evernote/client/android/EvernoteOAuthActivity;)Ljava/lang/String;
    .registers 2
    .param p0, "x0"    # Lcom/evernote/client/android/EvernoteOAuthActivity;

    .prologue
    .line 66
    iget-object v0, p0, Lcom/evernote/client/android/EvernoteOAuthActivity;->mRequestTokenSecret:Ljava/lang/String;

    return-object v0
.end method

.method static synthetic access$1202(Lcom/evernote/client/android/EvernoteOAuthActivity;Ljava/lang/String;)Ljava/lang/String;
    .registers 2
    .param p0, "x0"    # Lcom/evernote/client/android/EvernoteOAuthActivity;
    .param p1, "x1"    # Ljava/lang/String;

    .prologue
    .line 66
    iput-object p1, p0, Lcom/evernote/client/android/EvernoteOAuthActivity;->mRequestTokenSecret:Ljava/lang/String;

    return-object p1
.end method

.method static synthetic access$1300(Lcom/evernote/client/android/EvernoteOAuthActivity;)Z
    .registers 2
    .param p0, "x0"    # Lcom/evernote/client/android/EvernoteOAuthActivity;

    .prologue
    .line 66
    iget-boolean v0, p0, Lcom/evernote/client/android/EvernoteOAuthActivity;->mSupportAppLinkedNotebooks:Z

    return v0
.end method

.method static synthetic access$1400(Lcom/evernote/client/android/EvernoteOAuthActivity;)Landroid/webkit/WebView;
    .registers 2
    .param p0, "x0"    # Lcom/evernote/client/android/EvernoteOAuthActivity;

    .prologue
    .line 66
    iget-object v0, p0, Lcom/evernote/client/android/EvernoteOAuthActivity;->mWebView:Landroid/webkit/WebView;

    return-object v0
.end method

.method static synthetic access$1500(Lcom/evernote/client/android/EvernoteOAuthActivity;)V
    .registers 1
    .param p0, "x0"    # Lcom/evernote/client/android/EvernoteOAuthActivity;

    .prologue
    .line 66
    invoke-direct {p0}, Lcom/evernote/client/android/EvernoteOAuthActivity;->updateTitle()V

    return-void
.end method

.method static synthetic access$300(Lcom/evernote/client/android/EvernoteOAuthActivity;)Landroid/app/Activity;
    .registers 2
    .param p0, "x0"    # Lcom/evernote/client/android/EvernoteOAuthActivity;

    .prologue
    .line 66
    iget-object v0, p0, Lcom/evernote/client/android/EvernoteOAuthActivity;->mActivity:Landroid/app/Activity;

    return-object v0
.end method

.method static synthetic access$400(Lcom/evernote/client/android/EvernoteOAuthActivity;I)V
    .registers 2
    .param p0, "x0"    # Lcom/evernote/client/android/EvernoteOAuthActivity;
    .param p1, "x1"    # I

    .prologue
    .line 66
    invoke-direct {p0, p1}, Lcom/evernote/client/android/EvernoteOAuthActivity;->exit(I)V

    return-void
.end method

.method static synthetic access$500(Lcom/evernote/client/android/EvernoteOAuthActivity;)Landroid/os/AsyncTask;
    .registers 2
    .param p0, "x0"    # Lcom/evernote/client/android/EvernoteOAuthActivity;

    .prologue
    .line 66
    iget-object v0, p0, Lcom/evernote/client/android/EvernoteOAuthActivity;->mBeginAuthSyncTask:Landroid/os/AsyncTask;

    return-object v0
.end method

.method static synthetic access$502(Lcom/evernote/client/android/EvernoteOAuthActivity;Landroid/os/AsyncTask;)Landroid/os/AsyncTask;
    .registers 2
    .param p0, "x0"    # Lcom/evernote/client/android/EvernoteOAuthActivity;
    .param p1, "x1"    # Landroid/os/AsyncTask;

    .prologue
    .line 66
    iput-object p1, p0, Lcom/evernote/client/android/EvernoteOAuthActivity;->mBeginAuthSyncTask:Landroid/os/AsyncTask;

    return-object p1
.end method

.method static synthetic access$600(Lcom/evernote/client/android/EvernoteOAuthActivity;)Lcom/evernote/edam/userstore/BootstrapProfile;
    .registers 2
    .param p0, "x0"    # Lcom/evernote/client/android/EvernoteOAuthActivity;

    .prologue
    .line 66
    iget-object v0, p0, Lcom/evernote/client/android/EvernoteOAuthActivity;->mSelectedBootstrapProfile:Lcom/evernote/edam/userstore/BootstrapProfile;

    return-object v0
.end method

.method static synthetic access$602(Lcom/evernote/client/android/EvernoteOAuthActivity;Lcom/evernote/edam/userstore/BootstrapProfile;)Lcom/evernote/edam/userstore/BootstrapProfile;
    .registers 2
    .param p0, "x0"    # Lcom/evernote/client/android/EvernoteOAuthActivity;
    .param p1, "x1"    # Lcom/evernote/edam/userstore/BootstrapProfile;

    .prologue
    .line 66
    iput-object p1, p0, Lcom/evernote/client/android/EvernoteOAuthActivity;->mSelectedBootstrapProfile:Lcom/evernote/edam/userstore/BootstrapProfile;

    return-object p1
.end method

.method static synthetic access$700(Lcom/evernote/client/android/EvernoteOAuthActivity;)Ljava/util/ArrayList;
    .registers 2
    .param p0, "x0"    # Lcom/evernote/client/android/EvernoteOAuthActivity;

    .prologue
    .line 66
    iget-object v0, p0, Lcom/evernote/client/android/EvernoteOAuthActivity;->mBootstrapProfiles:Ljava/util/ArrayList;

    return-object v0
.end method

.method static synthetic access$702(Lcom/evernote/client/android/EvernoteOAuthActivity;Ljava/util/ArrayList;)Ljava/util/ArrayList;
    .registers 2
    .param p0, "x0"    # Lcom/evernote/client/android/EvernoteOAuthActivity;
    .param p1, "x1"    # Ljava/util/ArrayList;

    .prologue
    .line 66
    iput-object p1, p0, Lcom/evernote/client/android/EvernoteOAuthActivity;->mBootstrapProfiles:Ljava/util/ArrayList;

    return-object p1
.end method

.method static synthetic access$800(Lcom/evernote/client/android/EvernoteOAuthActivity;)I
    .registers 2
    .param p0, "x0"    # Lcom/evernote/client/android/EvernoteOAuthActivity;

    .prologue
    .line 66
    iget v0, p0, Lcom/evernote/client/android/EvernoteOAuthActivity;->mSelectedBootstrapProfilePos:I

    return v0
.end method

.method static synthetic access$802(Lcom/evernote/client/android/EvernoteOAuthActivity;I)I
    .registers 2
    .param p0, "x0"    # Lcom/evernote/client/android/EvernoteOAuthActivity;
    .param p1, "x1"    # I

    .prologue
    .line 66
    iput p1, p0, Lcom/evernote/client/android/EvernoteOAuthActivity;->mSelectedBootstrapProfilePos:I

    return p1
.end method

.method private createService()Lorg/scribe/oauth/OAuthService;
    .registers 7

    .prologue
    .line 284
    const/4 v1, 0x0

    .line 286
    .local v1, "builder":Lorg/scribe/oauth/OAuthService;
    const/4 v0, 0x0

    .line 287
    .local v0, "apiClass":Ljava/lang/Class;
    iget-object v3, p0, Lcom/evernote/client/android/EvernoteOAuthActivity;->mSelectedBootstrapProfile:Lcom/evernote/edam/userstore/BootstrapProfile;

    invoke-virtual {v3}, Lcom/evernote/edam/userstore/BootstrapProfile;->getSettings()Lcom/evernote/edam/userstore/BootstrapSettings;

    move-result-object v3

    invoke-virtual {v3}, Lcom/evernote/edam/userstore/BootstrapSettings;->getServiceHost()Ljava/lang/String;

    move-result-object v2

    .line 289
    .local v2, "host":Ljava/lang/String;
    if-eqz v2, :cond_29

    const-string v3, "http"

    invoke-virtual {v2, v3}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v3

    if-nez v3, :cond_29

    .line 290
    new-instance v3, Ljava/lang/StringBuilder;

    invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V

    const-string v4, "https://"

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    .line 293
    :cond_29
    const-string v3, "https://sandbox.evernote.com"

    invoke-virtual {v2, v3}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v3

    if-eqz v3, :cond_68

    .line 294
    const-class v0, Lorg/scribe/builder/api/EvernoteApi$Sandbox;

    .line 302
    :goto_33
    new-instance v3, Lorg/scribe/builder/ServiceBuilder;

    invoke-direct {v3}, Lorg/scribe/builder/ServiceBuilder;-><init>()V

    invoke-virtual {v3, v0}, Lorg/scribe/builder/ServiceBuilder;->provider(Ljava/lang/Class;)Lorg/scribe/builder/ServiceBuilder;

    move-result-object v3

    iget-object v4, p0, Lcom/evernote/client/android/EvernoteOAuthActivity;->mConsumerKey:Ljava/lang/String;

    invoke-virtual {v3, v4}, Lorg/scribe/builder/ServiceBuilder;->apiKey(Ljava/lang/String;)Lorg/scribe/builder/ServiceBuilder;

    move-result-object v3

    iget-object v4, p0, Lcom/evernote/client/android/EvernoteOAuthActivity;->mConsumerSecret:Ljava/lang/String;

    invoke-virtual {v3, v4}, Lorg/scribe/builder/ServiceBuilder;->apiSecret(Ljava/lang/String;)Lorg/scribe/builder/ServiceBuilder;

    move-result-object v3

    new-instance v4, Ljava/lang/StringBuilder;

    invoke-direct {v4}, Ljava/lang/StringBuilder;-><init>()V

    invoke-direct {p0}, Lcom/evernote/client/android/EvernoteOAuthActivity;->getCallbackScheme()Ljava/lang/String;

    move-result-object v5

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    const-string v5, "://callback"

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v3, v4}, Lorg/scribe/builder/ServiceBuilder;->callback(Ljava/lang/String;)Lorg/scribe/builder/ServiceBuilder;

    move-result-object v3

    invoke-virtual {v3}, Lorg/scribe/builder/ServiceBuilder;->build()Lorg/scribe/oauth/OAuthService;

    move-result-object v1

    .line 304
    return-object v1

    .line 295
    :cond_68
    const-string v3, "https://www.evernote.com"

    invoke-virtual {v2, v3}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v3

    if-eqz v3, :cond_73

    .line 296
    const-class v0, Lorg/scribe/builder/api/EvernoteApi;

    goto :goto_33

    .line 297
    :cond_73
    const-string v3, "https://app.yinxiang.com"

    invoke-virtual {v2, v3}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v3

    if-eqz v3, :cond_7e

    .line 298
    const-class v0, Lcom/evernote/client/oauth/YinxiangApi;

    goto :goto_33

    .line 300
    :cond_7e
    new-instance v3, Ljava/lang/IllegalArgumentException;

    new-instance v4, Ljava/lang/StringBuilder;

    invoke-direct {v4}, Ljava/lang/StringBuilder;-><init>()V

    const-string v5, "Unsupported Evernote host: "

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v4, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v4

    invoke-direct {v3, v4}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V

    throw v3
.end method

.method private exit(I)V
    .registers 3
    .param p1, "resultCode"    # I

    .prologue
    .line 312
    new-instance v0, Lcom/evernote/client/android/EvernoteOAuthActivity$5;

    invoke-direct {v0, p0, p1}, Lcom/evernote/client/android/EvernoteOAuthActivity$5;-><init>(Lcom/evernote/client/android/EvernoteOAuthActivity;I)V

    invoke-virtual {p0, v0}, Lcom/evernote/client/android/EvernoteOAuthActivity;->runOnUiThread(Ljava/lang/Runnable;)V

    .line 322
    return-void
.end method

.method private getCallbackScheme()Ljava/lang/String;
    .registers 2

    .prologue
    .line 276
    const-string v0, "en-oauth"

    return-object v0
.end method

.method private initWidgetsActions()V
    .registers 3

    .prologue
    .line 181
    iget-object v0, p0, Lcom/evernote/client/android/EvernoteOAuthActivity;->mBackBtn:Landroid/view/View;

    new-instance v1, Lcom/evernote/client/android/EvernoteOAuthActivity$3;

    invoke-direct {v1, p0}, Lcom/evernote/client/android/EvernoteOAuthActivity$3;-><init>(Lcom/evernote/client/android/EvernoteOAuthActivity;)V

    invoke-virtual {v0, v1}, Landroid/view/View;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    .line 189
    iget-object v0, p0, Lcom/evernote/client/android/EvernoteOAuthActivity;->mTitleTxt:Landroid/widget/TextView;

    new-instance v1, Lcom/evernote/client/android/EvernoteOAuthActivity$4;

    invoke-direct {v1, p0}, Lcom/evernote/client/android/EvernoteOAuthActivity$4;-><init>(Lcom/evernote/client/android/EvernoteOAuthActivity;)V

    invoke-virtual {v0, v1}, Landroid/widget/TextView;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    .line 205
    return-void
.end method

.method private updateTitle()V
    .registers 3

    .prologue
    .line 208
    iget-object v0, p0, Lcom/evernote/client/android/EvernoteOAuthActivity;->mBootstrapProfiles:Ljava/util/ArrayList;

    if-eqz v0, :cond_22

    iget-object v0, p0, Lcom/evernote/client/android/EvernoteOAuthActivity;->mBootstrapProfiles:Ljava/util/ArrayList;

    invoke-virtual {v0}, Ljava/util/ArrayList;->size()I

    move-result v0

    const/4 v1, 0x1

    if-le v0, v1, :cond_22

    .line 209
    const-string v0, "Evernote-China"

    iget-object v1, p0, Lcom/evernote/client/android/EvernoteOAuthActivity;->mSelectedBootstrapProfile:Lcom/evernote/edam/userstore/BootstrapProfile;

    invoke-virtual {v1}, Lcom/evernote/edam/userstore/BootstrapProfile;->getName()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_23

    .line 210
    iget-object v0, p0, Lcom/evernote/client/android/EvernoteOAuthActivity;->mTitleTxt:Landroid/widget/TextView;

    const-string v1, "Evernote International"

    invoke-virtual {v0, v1}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 216
    :cond_22
    :goto_22
    return-void

    .line 212
    :cond_23
    iget-object v0, p0, Lcom/evernote/client/android/EvernoteOAuthActivity;->mTitleTxt:Landroid/widget/TextView;

    const-string v1, "\u5370\u8c61\u7b14\u8bb0"

    invoke-virtual {v0, v1}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    goto :goto_22
.end method


# virtual methods
.method public onCreate(Landroid/os/Bundle;)V
    .registers 6
    .param p1, "savedInstanceState"    # Landroid/os/Bundle;
    .annotation build Landroid/annotation/SuppressLint;
        value = {
            "SetJavaScriptEnabled"
        }
    .end annotation

    .prologue
    const/4 v3, 0x1

    .line 135
    invoke-super {p0, p1}, Landroid/app/Activity;->onCreate(Landroid/os/Bundle;)V

    .line 138
    invoke-virtual {p0}, Lcom/evernote/client/android/EvernoteOAuthActivity;->getWindow()Landroid/view/Window;

    move-result-object v1

    invoke-virtual {v1, v3}, Landroid/view/Window;->requestFeature(I)Z

    .line 139
    invoke-virtual {p0}, Lcom/evernote/client/android/EvernoteOAuthActivity;->getWindow()Landroid/view/Window;

    move-result-object v1

    const/4 v2, 0x2

    invoke-virtual {v1, v2}, Landroid/view/Window;->requestFeature(I)Z

    .line 141
    sget v1, Lcom/evernote/androidsdk/R$layout;->esdk__webview:I

    invoke-virtual {p0, v1}, Lcom/evernote/client/android/EvernoteOAuthActivity;->setContentView(I)V

    .line 142
    iput-object p0, p0, Lcom/evernote/client/android/EvernoteOAuthActivity;->mActivity:Landroid/app/Activity;

    .line 144
    sget v1, Lcom/evernote/androidsdk/R$id;->btn_back:I

    invoke-virtual {p0, v1}, Lcom/evernote/client/android/EvernoteOAuthActivity;->findViewById(I)Landroid/view/View;

    move-result-object v1

    iput-object v1, p0, Lcom/evernote/client/android/EvernoteOAuthActivity;->mBackBtn:Landroid/view/View;

    .line 145
    sget v1, Lcom/evernote/androidsdk/R$id;->txt_title:I

    invoke-virtual {p0, v1}, Lcom/evernote/client/android/EvernoteOAuthActivity;->findViewById(I)Landroid/view/View;

    move-result-object v1

    check-cast v1, Landroid/widget/TextView;

    iput-object v1, p0, Lcom/evernote/client/android/EvernoteOAuthActivity;->mTitleTxt:Landroid/widget/TextView;

    .line 146
    sget v1, Lcom/evernote/androidsdk/R$id;->txt_switch:I

    invoke-virtual {p0, v1}, Lcom/evernote/client/android/EvernoteOAuthActivity;->findViewById(I)Landroid/view/View;

    move-result-object v1

    check-cast v1, Landroid/widget/TextView;

    iput-object v1, p0, Lcom/evernote/client/android/EvernoteOAuthActivity;->mSwitchTxt:Landroid/widget/TextView;

    .line 147
    iget-object v1, p0, Lcom/evernote/client/android/EvernoteOAuthActivity;->mTitleTxt:Landroid/widget/TextView;

    const-string v2, "Evernote International"

    invoke-virtual {v1, v2}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 150
    sget v1, Lcom/evernote/androidsdk/R$id;->esdk__webview:I

    invoke-virtual {p0, v1}, Lcom/evernote/client/android/EvernoteOAuthActivity;->findViewById(I)Landroid/view/View;

    move-result-object v1

    check-cast v1, Landroid/webkit/WebView;

    iput-object v1, p0, Lcom/evernote/client/android/EvernoteOAuthActivity;->mWebView:Landroid/webkit/WebView;

    .line 151
    iget-object v1, p0, Lcom/evernote/client/android/EvernoteOAuthActivity;->mWebView:Landroid/webkit/WebView;

    iget-object v2, p0, Lcom/evernote/client/android/EvernoteOAuthActivity;->mWebViewClient:Landroid/webkit/WebViewClient;

    invoke-virtual {v1, v2}, Landroid/webkit/WebView;->setWebViewClient(Landroid/webkit/WebViewClient;)V

    .line 152
    iget-object v1, p0, Lcom/evernote/client/android/EvernoteOAuthActivity;->mWebView:Landroid/webkit/WebView;

    iget-object v2, p0, Lcom/evernote/client/android/EvernoteOAuthActivity;->mWebChromeClient:Landroid/webkit/WebChromeClient;

    invoke-virtual {v1, v2}, Landroid/webkit/WebView;->setWebChromeClient(Landroid/webkit/WebChromeClient;)V

    .line 153
    iget-object v1, p0, Lcom/evernote/client/android/EvernoteOAuthActivity;->mWebView:Landroid/webkit/WebView;

    invoke-virtual {v1}, Landroid/webkit/WebView;->getSettings()Landroid/webkit/WebSettings;

    move-result-object v1

    invoke-virtual {v1, v3}, Landroid/webkit/WebSettings;->setJavaScriptEnabled(Z)V

    .line 155
    if-eqz p1, :cond_ba

    .line 156
    const-string v1, "EVERNOTE_HOST"

    invoke-virtual {p1, v1}, Landroid/os/Bundle;->getParcelable(Ljava/lang/String;)Landroid/os/Parcelable;

    move-result-object v1

    check-cast v1, Lcom/evernote/client/android/EvernoteSession$EvernoteService;

    iput-object v1, p0, Lcom/evernote/client/android/EvernoteOAuthActivity;->mEvernoteService:Lcom/evernote/client/android/EvernoteSession$EvernoteService;

    .line 157
    const-string v1, "CONSUMER_KEY"

    invoke-virtual {p1, v1}, Landroid/os/Bundle;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    iput-object v1, p0, Lcom/evernote/client/android/EvernoteOAuthActivity;->mConsumerKey:Ljava/lang/String;

    .line 158
    const-string v1, "CONSUMER_SECRET"

    invoke-virtual {p1, v1}, Landroid/os/Bundle;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    iput-object v1, p0, Lcom/evernote/client/android/EvernoteOAuthActivity;->mConsumerSecret:Ljava/lang/String;

    .line 159
    const-string v1, "REQUEST_TOKEN"

    invoke-virtual {p1, v1}, Landroid/os/Bundle;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    iput-object v1, p0, Lcom/evernote/client/android/EvernoteOAuthActivity;->mRequestToken:Ljava/lang/String;

    .line 160
    const-string v1, "REQUEST_TOKEN_SECRET"

    invoke-virtual {p1, v1}, Landroid/os/Bundle;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    iput-object v1, p0, Lcom/evernote/client/android/EvernoteOAuthActivity;->mRequestTokenSecret:Ljava/lang/String;

    .line 161
    const-string v1, "SUPPORT_APP_LINKED_NOTEBOOKS"

    invoke-virtual {p1, v1}, Landroid/os/Bundle;->getBoolean(Ljava/lang/String;)Z

    move-result v1

    iput-boolean v1, p0, Lcom/evernote/client/android/EvernoteOAuthActivity;->mSupportAppLinkedNotebooks:Z

    .line 162
    const-string v1, "BOOTSTRAP_SELECTED_PROFILE"

    invoke-virtual {p1, v1}, Landroid/os/Bundle;->getSerializable(Ljava/lang/String;)Ljava/io/Serializable;

    move-result-object v1

    check-cast v1, Lcom/evernote/edam/userstore/BootstrapProfile;

    iput-object v1, p0, Lcom/evernote/client/android/EvernoteOAuthActivity;->mSelectedBootstrapProfile:Lcom/evernote/edam/userstore/BootstrapProfile;

    .line 163
    const-string v1, "BOOTSTRAP_SELECTED_PROFILE_POS"

    invoke-virtual {p1, v1}, Landroid/os/Bundle;->getInt(Ljava/lang/String;)I

    move-result v1

    iput v1, p0, Lcom/evernote/client/android/EvernoteOAuthActivity;->mSelectedBootstrapProfilePos:I

    .line 164
    const-string v1, "BOOTSTRAP_SELECTED_PROFILES"

    invoke-virtual {p1, v1}, Landroid/os/Bundle;->getSerializable(Ljava/lang/String;)Ljava/io/Serializable;

    move-result-object v1

    check-cast v1, Ljava/util/ArrayList;

    iput-object v1, p0, Lcom/evernote/client/android/EvernoteOAuthActivity;->mBootstrapProfiles:Ljava/util/ArrayList;

    .line 165
    iget-object v1, p0, Lcom/evernote/client/android/EvernoteOAuthActivity;->mWebView:Landroid/webkit/WebView;

    invoke-virtual {v1, p1}, Landroid/webkit/WebView;->restoreState(Landroid/os/Bundle;)Landroid/webkit/WebBackForwardList;

    .line 175
    :goto_b3
    invoke-direct {p0}, Lcom/evernote/client/android/EvernoteOAuthActivity;->updateTitle()V

    .line 177
    invoke-direct {p0}, Lcom/evernote/client/android/EvernoteOAuthActivity;->initWidgetsActions()V

    .line 178
    return-void

    .line 168
    :cond_ba
    invoke-virtual {p0}, Lcom/evernote/client/android/EvernoteOAuthActivity;->getIntent()Landroid/content/Intent;

    move-result-object v0

    .line 169
    .local v0, "intent":Landroid/content/Intent;
    const-string v1, "EVERNOTE_HOST"

    invoke-virtual {v0, v1}, Landroid/content/Intent;->getParcelableExtra(Ljava/lang/String;)Landroid/os/Parcelable;

    move-result-object v1

    check-cast v1, Lcom/evernote/client/android/EvernoteSession$EvernoteService;

    iput-object v1, p0, Lcom/evernote/client/android/EvernoteOAuthActivity;->mEvernoteService:Lcom/evernote/client/android/EvernoteSession$EvernoteService;

    .line 170
    const-string v1, "CONSUMER_KEY"

    invoke-virtual {v0, v1}, Landroid/content/Intent;->getStringExtra(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    iput-object v1, p0, Lcom/evernote/client/android/EvernoteOAuthActivity;->mConsumerKey:Ljava/lang/String;

    .line 171
    const-string v1, "CONSUMER_SECRET"

    invoke-virtual {v0, v1}, Landroid/content/Intent;->getStringExtra(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    iput-object v1, p0, Lcom/evernote/client/android/EvernoteOAuthActivity;->mConsumerSecret:Ljava/lang/String;

    .line 172
    const-string v1, "SUPPORT_APP_LINKED_NOTEBOOKS"

    const/4 v2, 0x0

    invoke-virtual {v0, v1, v2}, Landroid/content/Intent;->getBooleanExtra(Ljava/lang/String;Z)Z

    move-result v1

    iput-boolean v1, p0, Lcom/evernote/client/android/EvernoteOAuthActivity;->mSupportAppLinkedNotebooks:Z

    goto :goto_b3
.end method

.method protected onCreateDialog(I)Landroid/app/Dialog;
    .registers 3
    .param p1, "id"    # I

    .prologue
    .line 255
    packed-switch p1, :pswitch_data_e

    .line 259
    invoke-super {p0, p1}, Landroid/app/Activity;->onCreateDialog(I)Landroid/app/Dialog;

    move-result-object v0

    :goto_7
    return-object v0

    .line 257
    :pswitch_8
    new-instance v0, Landroid/app/ProgressDialog;

    invoke-direct {v0, p0}, Landroid/app/ProgressDialog;-><init>(Landroid/content/Context;)V

    goto :goto_7

    .line 255
    :pswitch_data_e
    .packed-switch 0x65
        :pswitch_8
    .end packed-switch
.end method

.method protected onPrepareDialog(ILandroid/app/Dialog;)V
    .registers 5
    .param p1, "id"    # I
    .param p2, "dialog"    # Landroid/app/Dialog;

    .prologue
    .line 264
    packed-switch p1, :pswitch_data_1c

    .line 270
    .end local p2    # "dialog":Landroid/app/Dialog;
    :goto_3
    return-void

    .restart local p2    # "dialog":Landroid/app/Dialog;
    :pswitch_4
    move-object v0, p2

    .line 266
    check-cast v0, Landroid/app/ProgressDialog;

    const/4 v1, 0x1

    invoke-virtual {v0, v1}, Landroid/app/ProgressDialog;->setIndeterminate(Z)V

    .line 267
    const/4 v0, 0x0

    invoke-virtual {p2, v0}, Landroid/app/Dialog;->setCancelable(Z)V

    .line 268
    check-cast p2, Landroid/app/ProgressDialog;

    .end local p2    # "dialog":Landroid/app/Dialog;
    sget v0, Lcom/evernote/androidsdk/R$string;->esdk__loading:I

    invoke-virtual {p0, v0}, Lcom/evernote/client/android/EvernoteOAuthActivity;->getString(I)Ljava/lang/String;

    move-result-object v0

    invoke-virtual {p2, v0}, Landroid/app/ProgressDialog;->setMessage(Ljava/lang/CharSequence;)V

    goto :goto_3

    .line 264
    nop

    :pswitch_data_1c
    .packed-switch 0x65
        :pswitch_4
    .end packed-switch
.end method

.method protected onResume()V
    .registers 3

    .prologue
    .line 220
    invoke-super {p0}, Landroid/app/Activity;->onResume()V

    .line 222
    iget-object v0, p0, Lcom/evernote/client/android/EvernoteOAuthActivity;->mConsumerKey:Ljava/lang/String;

    invoke-static {v0}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v0

    if-nez v0, :cond_13

    iget-object v0, p0, Lcom/evernote/client/android/EvernoteOAuthActivity;->mConsumerSecret:Ljava/lang/String;

    invoke-static {v0}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v0

    if-eqz v0, :cond_19

    .line 223
    :cond_13
    const/16 v0, 0x2710

    invoke-direct {p0, v0}, Lcom/evernote/client/android/EvernoteOAuthActivity;->exit(I)V

    .line 230
    :cond_18
    :goto_18
    return-void

    .line 227
    :cond_19
    iget-object v0, p0, Lcom/evernote/client/android/EvernoteOAuthActivity;->mSelectedBootstrapProfile:Lcom/evernote/edam/userstore/BootstrapProfile;

    if-nez v0, :cond_18

    .line 228
    new-instance v0, Lcom/evernote/client/android/EvernoteOAuthActivity$BootstrapAsyncTask;

    const/4 v1, 0x0

    invoke-direct {v0, p0, v1}, Lcom/evernote/client/android/EvernoteOAuthActivity$BootstrapAsyncTask;-><init>(Lcom/evernote/client/android/EvernoteOAuthActivity;Lcom/evernote/client/android/EvernoteOAuthActivity$1;)V

    const/4 v1, 0x0

    new-array v1, v1, [Ljava/lang/Void;

    invoke-virtual {v0, v1}, Lcom/evernote/client/android/EvernoteOAuthActivity$BootstrapAsyncTask;->execute([Ljava/lang/Object;)Landroid/os/AsyncTask;

    move-result-object v0

    iput-object v0, p0, Lcom/evernote/client/android/EvernoteOAuthActivity;->mBeginAuthSyncTask:Landroid/os/AsyncTask;

    goto :goto_18
.end method

.method protected onSaveInstanceState(Landroid/os/Bundle;)V
    .registers 4
    .param p1, "outState"    # Landroid/os/Bundle;

    .prologue
    .line 239
    const-string v0, "EVERNOTE_HOST"

    iget-object v1, p0, Lcom/evernote/client/android/EvernoteOAuthActivity;->mEvernoteService:Lcom/evernote/client/android/EvernoteSession$EvernoteService;

    invoke-virtual {p1, v0, v1}, Landroid/os/Bundle;->putParcelable(Ljava/lang/String;Landroid/os/Parcelable;)V

    .line 240
    const-string v0, "CONSUMER_KEY"

    iget-object v1, p0, Lcom/evernote/client/android/EvernoteOAuthActivity;->mConsumerKey:Ljava/lang/String;

    invoke-virtual {p1, v0, v1}, Landroid/os/Bundle;->putString(Ljava/lang/String;Ljava/lang/String;)V

    .line 241
    const-string v0, "CONSUMER_SECRET"

    iget-object v1, p0, Lcom/evernote/client/android/EvernoteOAuthActivity;->mConsumerSecret:Ljava/lang/String;

    invoke-virtual {p1, v0, v1}, Landroid/os/Bundle;->putString(Ljava/lang/String;Ljava/lang/String;)V

    .line 242
    const-string v0, "SUPPORT_APP_LINKED_NOTEBOOKS"

    iget-boolean v1, p0, Lcom/evernote/client/android/EvernoteOAuthActivity;->mSupportAppLinkedNotebooks:Z

    invoke-virtual {p1, v0, v1}, Landroid/os/Bundle;->putBoolean(Ljava/lang/String;Z)V

    .line 243
    const-string v0, "REQUEST_TOKEN"

    iget-object v1, p0, Lcom/evernote/client/android/EvernoteOAuthActivity;->mRequestToken:Ljava/lang/String;

    invoke-virtual {p1, v0, v1}, Landroid/os/Bundle;->putString(Ljava/lang/String;Ljava/lang/String;)V

    .line 244
    const-string v0, "REQUEST_TOKEN_SECRET"

    iget-object v1, p0, Lcom/evernote/client/android/EvernoteOAuthActivity;->mRequestTokenSecret:Ljava/lang/String;

    invoke-virtual {p1, v0, v1}, Landroid/os/Bundle;->putString(Ljava/lang/String;Ljava/lang/String;)V

    .line 245
    const-string v0, "BOOTSTRAP_SELECTED_PROFILE"

    iget-object v1, p0, Lcom/evernote/client/android/EvernoteOAuthActivity;->mSelectedBootstrapProfile:Lcom/evernote/edam/userstore/BootstrapProfile;

    invoke-virtual {p1, v0, v1}, Landroid/os/Bundle;->putSerializable(Ljava/lang/String;Ljava/io/Serializable;)V

    .line 246
    const-string v0, "BOOTSTRAP_SELECTED_PROFILE_POS"

    iget v1, p0, Lcom/evernote/client/android/EvernoteOAuthActivity;->mSelectedBootstrapProfilePos:I

    invoke-virtual {p1, v0, v1}, Landroid/os/Bundle;->putInt(Ljava/lang/String;I)V

    .line 247
    const-string v0, "BOOTSTRAP_SELECTED_PROFILES"

    iget-object v1, p0, Lcom/evernote/client/android/EvernoteOAuthActivity;->mBootstrapProfiles:Ljava/util/ArrayList;

    invoke-virtual {p1, v0, v1}, Landroid/os/Bundle;->putSerializable(Ljava/lang/String;Ljava/io/Serializable;)V

    .line 248
    iget-object v0, p0, Lcom/evernote/client/android/EvernoteOAuthActivity;->mWebView:Landroid/webkit/WebView;

    invoke-virtual {v0, p1}, Landroid/webkit/WebView;->saveState(Landroid/os/Bundle;)Landroid/webkit/WebBackForwardList;

    .line 250
    invoke-super {p0, p1}, Landroid/app/Activity;->onSaveInstanceState(Landroid/os/Bundle;)V

    .line 251
    return-void
.end method
